<?php
/** 
 * Represents a single file from a resourcepage item. Used within
 * resourcepage_item.
 * 
 * @copyright &copy; 2006 The Open University
 * @author s.marshall@open.ac.uk
 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
 * @package resourcepage 
 */ 
class resourcepage_file {
    
    /** Database fields */
    private $filepath,$mimetype,$size,$frombase;
    
    /**
     * Initialises from data.
     * @param string $filepath Path of file
     * @param string $mimetype MIME type
     * @param int $size Size in bytes 
     * @param boolean $frombase True if from base item, false if this is directly from the item
     */
    public function __construct($filepath,$mimetype,$size,$frombase) {
        $this->filepath=$filepath;
        $this->mimetype=$mimetype;
        $this->size=$size;        
        $this->frombase=$frombase;
    }
    
    /** @return string Path of file */
    public function get_filepath() { return $this->filepath; } 
    /** @return string MIME type */
    public function get_mime_type() { return $this->mimetype; } 
    /** @return int Size in bytes */
    public function get_size() { return $this->size; } 
    /** @return bool True if from base item */
    public function get_from_base() { return $this->frombase; } 
}
?>